//
//  MyAccountHeadView.m
//  RedManStock
//
//  Created by lanou3g on 15/8/1.
//  Copyright (c) 2015年 lanou3g. All rights reserved.
//

#import "MyAccountHeadView.h"
#import "DataHandle.h"
#import "ParameterHeader.h"
@implementation MyAccountHeadView

/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

- (void)layoutUserInfoWithUser:(User *)myUser{
    
    self.totalAssetLabel.text=[myUser.totalAsset stringByAppendingString:@"元"];
    self.availableAssetsLabel.text=[myUser.availableAsset stringByAppendingString:@"元"];
    self.totalPriceLabel.text=[myUser.totalPrice stringByAppendingString:@"元"];
    self.totalYieldRateLabel.text=[NSString stringWithFormat:@"总收益率 %@",myUser.totalYield];
    self.day_yieldRateLabel.text=[NSString stringWithFormat:@"今日收益率 %@",myUser.day_yieldRate];
    if ([myUser.day_yield floatValue]>=0) {
        self.backgroundColor=MyRedColor;
    }
    else{
        self.backgroundColor=MyGreenColor;
    }
    if ([myUser.day_yield isEqualToString:@"0.00"]) {
        self.day_yieldLabel.text=@"暂无收益";
    }
    else{
        self.day_yieldLabel.text=myUser.day_yield;
    }
}

@end
